<?php

require_once("lib/autoload.php");

#header('Content-type: application/json');

$id = $_GET["id"];
$user = $_GET["user"];
$comment = $_GET["comment"];
$result = false;
if (isset($id) && isset($user)) {
    if (!isset($comment)) {
        $comment = '';
    }
    $dc = new DataController();
    $dc->connect();
    $result = $dc->signPetition($id, $user, $comment);
    $dc->disconnect();
}
if ($result) {
    print "{success: 'true'}";
}
else {
    print "{success: 'false'}";   
}

?>